package com.uh.checking.filter;

import java.io.File;
import java.io.FilenameFilter;

public class ExcludeNameFilter implements FilenameFilter {

    private String[] filenames;

    private String prefix;


    public ExcludeNameFilter(String[] filenames) {
        this.filenames = filenames;
    }

    @Override
    public boolean accept(File dir, String name) {
        //如果和对应的文件相同返回false ,否则true
        for(String filename :filenames) {
            if (name.equalsIgnoreCase(filename)) {
                return false;
            }
        }

        return true;
    }
}
